package mulegame;

import javax.swing.*;
import javax.swing.border.TitledBorder;
import java.awt.*;
/**
 * Creates an instruction box and sets text within to direct player during gameplay
 * @author AREA 29
 *
 */
public class Instructions extends JPanel{
    final private JTextArea text;
    /**
     * Sets instruction box layout
     */
    public Instructions(){
        super();   
        setBorder(new TitledBorder(null, "Instructions",
                    TitledBorder.LEADING, TitledBorder.TOP, null, null));
        setBounds(152, 377, 625, 107);
        setLayout(null);
        
        text = new JTextArea();
        text.setBounds(6, 16, 613, 84);
        text.setBackground(Color.WHITE);
        text.setWrapStyleWord(true);
        text.setLineWrap(true);
        text.setForeground(Color.BLUE);
        text.setFont(new Font("MV Boli", Font.PLAIN, 20));
        text.setEditable(false);
        add(text);
    }
    /**
     * sets instruction text 
     * @param msg message to be displayed 
     */
    public void setText(final String msg){
       text.setText(msg);
    }
}

    /*    
            JPanel panelInst = new JPanel();
            panelInst.setBorder(new TitledBorder(null, "Instructions",
                    TitledBorder.LEADING, TitledBorder.TOP, null, null));
            panelInst.setBounds(152, 377, 625, 107);
            add(panelInst);
            panelInst.setLayout(null);
    
            txtrPlayer = new JTextArea();
            txtrPlayer.setBounds(6, 16, 613, 84);
            txtrPlayer.setBackground(Color.WHITE);
            txtrPlayer.setWrapStyleWord(true);
            txtrPlayer.setLineWrap(true);
            txtrPlayer.setForeground(Color.BLUE);
            txtrPlayer.setFont(new Font("MV Boli", Font.PLAIN, 20));
            txtrPlayer.setEditable(false);
            panelInst.add(txtrPlayer);
    */
